package com.sneaker.shower.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.sneaker.shower.entity.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("客服发送消息model")
public class MessageDTO extends BaseDomain {

    private Long userGuid;
    private Long sysUserGuid;
    private String sessionGuid;
    @ApiModelProperty("图片:imgae, 文本:text")
    private String messageType;
    private Long organizationGuid;
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime sendTime;

    private UserDTO userDTO;

    @ApiModelProperty("消息类型，0 用户消息， 1客服消息")
    private Integer type;

    private Boolean hasRead = Boolean.FALSE;
}
